/**常用工具类 */
// 成功20000
const utils = {
    aa () {
        console.log(111);
    },
    result (err, res, message, message2, data = '') {
        if (err) {
            res.send({
                code: 40001,
                data: data,
                message: message
            })
            return
        }
        else {
            res.send({
                code: 20000,
                data: data,
                message: message2
            })
        }
    },
    error (err, res, message, data = '') {
        if (err) {
            res.send({
                code: 40001,
                data: data,
                message: message
            })
            return
        }
    },
    success (res, message, data = '') {
        res.send({
            code: 20000,
            data: data,
            message: message
        })
        return
    },
}
module.exports = utils